package com.usian.Controller;

import com.usian.pojo.TbContentCategory;
import com.usian.pojo.TbItem;
import com.usian.pojo.TbItemParam;
import com.usian.service.ItemService;
import com.usian.service.ParamService;
import com.usian.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ParamController {
    @Autowired
    private ParamService paramService;
    @RequestMapping("/selectItemParamByItemCatId/{itemCatId}")
    public TbItemParam selectItemParamByItemCatId(@PathVariable Integer itemCatId){
        return paramService.selectItemParamByItemCatId(itemCatId);
    }

    @RequestMapping("selectItemParamAll")
    public PageResult selectItemParamAll(){
        return paramService.selectItemParamAll();
    };

    @RequestMapping("insertItemParam")
    public int insertItemParam(@RequestParam Integer itemCatId,@RequestParam String paramData){
        return paramService.insertItemParam(itemCatId,paramData);
    };

    @RequestMapping("deleteItemParamById")
    public int deleteItemParamById(@RequestParam Integer id){
        return paramService.deleteItemParamById(id);
    }



}
